package com.example.b_308.myapplication.view.main;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.b_308.myapplication.R;
import com.example.b_308.myapplication.view.base.BaseFragment;
import com.example.b_308.myapplication.view.main.mine.AboutUsActivity;
import com.example.b_308.myapplication.view.main.mine.MineModifyPasswordActivity;
import com.example.b_308.myapplication.view.main.mine.PersonalDataActivity;

/**
 * Created by B-308 on 2017/11/21.
 */
public class MineFragment extends BaseFragment implements View.OnClickListener {

    LinearLayout iv_mine_check, iv_mine_edit_password, iv_mine_change_phone_number, iv_mine_about_us;
    @Nullable
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState){
        View view = inflater.inflate(R.layout.fragment_mine,null,false);
        return view;
    }

    @Override
    protected void init() {

        iv_mine_check = findViewById(R.id.iv_mine_check);
        iv_mine_edit_password = findViewById(R.id.iv_mine_edit_password);
        iv_mine_change_phone_number = findViewById(R.id.iv_mine_change_phone_number);
        iv_mine_about_us = findViewById(R.id.iv_mine_about_us);

        iv_mine_check.setOnClickListener(this);
        iv_mine_edit_password.setOnClickListener(this);
        iv_mine_change_phone_number.setOnClickListener(this);
        iv_mine_about_us.setOnClickListener(this);

    }

    @Override
    protected View setContentView(LayoutInflater inflater) {
        return null;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.iv_mine_check:
                ((MainActivity)getActivity()).tend2(PersonalDataActivity.class);
                break;
            case R.id.iv_mine_edit_password:
                ((MainActivity)getActivity()).tend2(MineModifyPasswordActivity.class);
                break;
            case R.id.iv_mine_change_phone_number:
                break;
            case R.id.iv_mine_about_us:
                ((MainActivity)getActivity()).tend2(AboutUsActivity.class);
                break;
        }
    }
}
